package com.example.mapstruct_demo.controller.mapper;


import com.example.mapstruct_demo.pojo.dto.UserDto;
import com.example.mapstruct_demo.pojo.vo.UserVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author 77229
 */
@Mapper
public interface UserMapper {
    UserMapper INSTANCE = Mappers.getMapper(UserMapper.class);

    @Mapping(source = "userId", target = "id")
    @Mapping(source = "tagList", target = "tags")
    UserDto vo2dto(UserVo userVo);

    @Mapping(source = "id", target = "userId")
    @Mapping(source = "tags", target = "tagList")
    UserVo dto2vo(UserDto userDto);
}
